﻿using System;
using System.Runtime.InteropServices;

namespace FlyRemote.Base
{
    internal static partial class NativeMethods
    {
        /// <summary>
        /// Determines whether the specified process is running under WOW64
        /// </summary>
        /// <param name="processHandle">A handle to the running process</param>
        /// <param name="wow64Process">Whether or not the process is 64 bit</param>
        /// <returns>
        /// A pointer to a value that is set to TRUE if the process is running under WOW64.
        /// If the process is running under 32-bit Windows, the value is set to FALSE.
        /// If the process is a 64-bit application running under 64-bit Windows, the value is also set to FALSE.
        /// </returns>
        [DllImport("kernel32.dll", SetLastError = true, CallingConvention = CallingConvention.Winapi)]
        [return: MarshalAs(UnmanagedType.Bool)]
        public static extern Boolean IsWow64Process([In] IntPtr processHandle, [Out, MarshalAs(UnmanagedType.Bool)] out Boolean wow64Process);
    }
}
